define(['app'],function(app){return {module: function($scope, $http, eventBusService, httpService, params, configService) {
        $scope.form = {};
        $scope.menu_name = "学生管理";





        //性别
        httpService.post(app.urls.dictionary_selectOne, {fk_rule:'SJAAAAA29'}, function(data) {
            if("0000" === data.code) {
                $scope.sexList = data.data;
            } else {
                eventBusService.publish("modal.alert", {"content": data.msg});
            }
        });


        $scope.find=function () {

            httpService.post(app.urls.newStudent_selectById, {id:params.id}, function(data) {
                if("0000" === data.code) {
                    $scope.form = data.data[0];
                } else {
                    eventBusService.publish("modal.alert", {"content": data.msg});
                }
            });
        }
        $scope.find();




        $scope.save = function() {
            if (!$scope.formCheck()){
                return;
            }

            httpService.post(app.urls.newStudent_update, $scope.form,function(data){
                if("0000" === data.code){
                    eventBusService.publish("modal.alert", {"content": "修改成功"});
                    eventBusService.publish("content.page.reload", null);
                    eventBusService.publish("modal.page.close",{});
                }else{
                    alert(data.msg);
                }
            });
        }

}}});
